package com.czk.ssabaidumap.controller;

import jakarta.annotation.Resource;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @Author: chenzhangkun
 * @CreateTime: 2025-11-03
 * @Description:
 * @Version: 1.0
 */
@RestController
public class BaiDuMapMcpController {

    @Resource(name = "qwenChatClient")
    private ChatClient chatClient;

    @GetMapping(value = "/mcp/chat")
    public Flux<String> chat(@RequestParam(name = "msg", defaultValue = "成都") String msg) {
        return chatClient.prompt(msg)
                .stream()
                .content();
    }

}
